package com.credithc.customers.manager.client;

import com.credithc.baseserv.core.message.Message;
import com.credithc.customers.manager.ro.TokenRo;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestHeader;

/**
 * @description: 调用auth服务认证
 * @author: denghx
 * @date: 2019/10/9 16:28
 * @param: null
 * @return:
 */
@FeignClient(name = "auth", serviceId = "auth")
//FeignClient(name = "auth", serviceId = "auth",url = "10.150.26.183")
//@FeignClient(name = "auth", serviceId = "auth" ,url = "10.150.30.54")
public interface AuthClient {

    @GetMapping("/api/auth/v1/getUserByToken")
    Message getUserByToken(@RequestHeader(name = "token", required = true) String token);

    /**
     * 根据Token获取用户信息
     *
     * @param token
     * @return
     */
    @GetMapping("/api/auth/v1/getUserByToken")
    Message<TokenRo> getUserInfoByToken(@RequestHeader(name = "token", required = true) String token);
}
